#pragma once
#include "World.h"
#include <fstream>
using namespace std;

enum WordType {
    WORD_ADD,
    WORD_SELECT,
    WORD_COMMAND,
    WORD_WHILE,
    WORD_INVALID
};

class CInterpreter
{
public:
    CInterpreter(string fileName);
    ~CInterpreter();

    void Interpret();
private:
    WordType ValidateWord(string word, string & returnArg, string & command);
    bool IsSemicolon(char ch);
    bool IsSpace(char ch);
    void Process(string word);
    void DeleteExtraFirstSpaces(string & str);
    bool IsNumber(const std::string & s);
    char GetChar();

    CWorld m_world;
    ifstream m_in;
    bool m_Io;
};

